<html manifest=node.manifest>
<head>
  <meta charset="utf-8">
  <title>Mixly mixpy</title>
  <script type="text/javascript" src="../../blockly_compressed_py.js"></script>
  <script type="text/javascript" src="../../python_compressed.js"></script>
  <script type="text/javascript" src="../../core/mixpy_python/variables.js"></script>
  <script type="text/javascript" src="../../core/procedures.js"></script>
  <script type="text/javascript" src="../../core/blockly.js"></script>
  <script type="text/javascript" src="../../core/events_new.js"></script>
  <script type="text/javascript" src="../../core/field_textarea.js"></script>
  <script type="text/javascript" src="../../core/mixpy_python/names.js"></script>
  <script src="../../generators/mixpy_python/python.js"></script>
  <script type="text/javascript" src="company_pin.js"></script>
  <script type="text/javascript" src="js/drag.js"></script>
  <script type="text/javascript" src="js/code.js"></script>
  <!--------from BlocklyDuino------------>
  <script type="text/javascript" src="js/Blob.js"></script>
  <script type="text/javascript" src="spin.js"></script>
  <script type="text/javascript" src="js/FileSaver.min.js"></script>
  <script type="text/javascript" src="js/blockly_helper.js"></script>
  <!------------------------------------->
  <script type="text/javascript" src="jquery-1.11.3.min.js"></script>
  <script type="text/javascript" src="mixpy/myblock.js"></script>
  <script type="text/javascript" src="../../blocks/python/variables.js"></script>
  <script type="text/javascript" src="../../generators/python/variables.js"></script>
  <script type="text/javascript" src="../../blocks/python/class.js"></script>
  <script type="text/javascript" src="../../generators/python/class.js"></script>
  <!-- blocks file -->
  <script src="../../blocks/mixpy_python/inout.js"></script>
  <script src="../../blocks/mixpy_python/system.js"></script>
  <script src="../../blocks/python/control.js"></script>
  <script src="../../blocks/python/math.js"></script>
  <script src="../../blocks/python/text.js"></script>
  <script src="../../blocks/python/lists.js"></script>
  <script src="../../blocks/python/dicts.js"></script>
  <script src="../../blocks/python/logic.js"></script>
  <script src="../../blocks/python/set.js"></script>
  <script src="../../blocks/mixpy_python/turtle.js"></script>
  <script src="../../blocks/mixpy_python/data.js"></script>
  <script src="../../blocks/python/tuple.js"></script>
  <script src="../../blocks/python/procedures.js"></script>
  <script src="../../blocks/mixpy_python/sklearn.js"></script>
  <!-- generator file -->
  <script src="../../generators/mixpy_python/inout.js"></script>
  <script src="../../generators/mixpy_python/system.js"></script>
  <script src="../../generators/python/control.js"></script>
  <script src="../../generators/python/math.js"></script>
  <script src="../../generators/python/text.js"></script>
  <script src="../../generators/python/lists.js"></script>
  <script src="../../generators/python/dicts.js"></script>
  <script src="../../generators/python/logic.js"></script>
  <script src="../../generators/python/set.js"></script>
  <script src="../../generators/mixpy_python/turtle.js"></script>
  <script src="../../generators/mixpy_python/data.js"></script>
  <script src="../../generators/python/tuple.js"></script>
  <script src="../../generators/python/procedures.js"></script>
  <script src="../../generators/mixpy_python/sklearn.js"></script>
  <script src="js/lib/ace/ace.js" type="application/javascript"></script>
  <script src="js/lib/ace/ext-language_tools.js" type="application/javascript"></script>
  <script src="../../blocks/python/utility.js"></script>
  <script src="../../generators/python/utility.js"></script>
  <script src="./js/py2block_editor.js" type="application/javascript"></script>
  <script src="../../converters/mixpy_python/py2block_config.js" type="application/javascript"></script>
  <script src="../../converters/mixpy_python/inout.js" type="application/javascript"></script>
  <script src="../../converters/mixpy_python/system.js" type="application/javascript"></script>
  <script src="../../converters/python/control.js" type="application/javascript"></script>
  <script src="../../converters/python/math.js" type="application/javascript"></script>
  <script src="../../converters/python/logic.js" type="application/javascript"></script>
  <script src="../../converters/python/text.js" type="application/javascript"></script>
  <script src="../../converters/python/lists.js" type="application/javascript"></script>
  <script src="../../converters/python/tuple.js" type="application/javascript"></script>
  <script src="../../converters/python/dicts.js" type="application/javascript"></script>
  <script src="../../converters/python/set.js" type="application/javascript"></script>
  <script src="../../converters/mixpy_python/turtle.js" type="application/javascript"></script>
  <script src="../../converters/mixpy_python/data.js" type="application/javascript"></script>
  <script src="../../converters/mixpy_python/sklearn.js" type="application/javascript"></script>
  <script src="./js/python_to_blockly.js" type="application/javascript"></script>
  <script src="js/mixpyProject.js" type="application/javascript"></script>  
  <script src="js/skulpt/dist/skulpt.min.js" type="application/javascript"></script>
  <script src="js/skulpt/dist/skulpt-stdlib.js" type="application/javascript"></script>
  <script src="js/skulpt/engine.js" type="application/javascript"></script>  
  <link rel="stylesheet" type="text/css" href="css/color_mixpy_python_skulpt.css" />
  <link rel="stylesheet" type="text/css" href="css/ACEfont.css" />
  <script>
    var sidecodeDisplay=false;
/**
 * 点击侧边显示代码按钮
 */
function sidecodeClick(){
  if(sidecodeDisplay){
  document.getElementById('side_code_parent').style.display = 'none';
  document.getElementById('sidebar').className='right-top';
  document.getElementById('mid_td').style.display = 'none';
  sidecodeDisplay=false;
  }else{
  document.getElementById('side_code_parent').style.display = '';
  document.getElementById('sidebar').className='right-top2';
  document.getElementById('mid_td').style.display = '';
  sidecodeDisplay=true;
  }
  Blockly.fireUiEvent(window, 'resize');
}
/**
 * List of tab names.
 * @private
 */
var TABS_ = ['blocks', 'arduino', 'xml'];
var selected = 'blocks';
/**
 * Switch the visible pane when a tab is clicked.
 * @param {string} clickedName Name of tab clicked.
 */
function tabClick(clickedName) {
  // If the XML tab was open, save and render the content.
  if (document.getElementById('tab_xml').className == 'tabon') {
    var xmlTextarea = document.getElementById('content_xml');
    var xmlText = xmlTextarea.value;
    var xmlDom = null;
    try {
      xmlDom = Blockly.Xml.textToDom(xmlText);
    } catch (e) {
      var q =
          window.confirm('Error parsing XML:\n' + e + '\n\nAbandon changes?');
      if (!q) {
        // Leave the user on the XML tab.
        return;
      }
    }
    if (xmlDom) {
      Blockly.mainWorkspace.clear();
      Blockly.Xml.domToWorkspace(xmlDom,Blockly.mainWorkspace);
    }
  }
  if (document.getElementById('tab_blocks').className == 'tabon') {
    Blockly.mainWorkspace.setVisible(false);
  }
  // Deselect all tabs and hide all panes.
  for (var i = 0; i < TABS_.length; i++) {
    var name = TABS_[i];
    document.getElementById('tab_' + name).className = 'taboff';
    document.getElementById('content_' + name).style.visibility = 'hidden';
  }
 // Select the active tab.
  selected = clickedName;
  document.getElementById('tab_' + clickedName).className = 'tabon';
  // Show the selected pane.
  document.getElementById('content_' + clickedName).style.visibility =
      'visible';
  renderContent();
  if (clickedName == 'blocks') {
    Blockly.mainWorkspace.setVisible(true);
  //重新显示
  if(sidecodeDisplay){
    document.getElementById('side_code_parent').style.display = '';
    document.getElementById('mid_td').style.display = '';
    document.getElementById('sidebar').className='right-top2';
    }else{
    document.getElementById('side_code_parent').style.display = 'none';
    document.getElementById('mid_td').style.display = 'none';
    document.getElementById('sidebar').className='right-top';
    }
  //显示右侧悬浮按钮
  document.getElementById('sidebar').style.visibility = 'visible';
    py2block_editor.updateBlock();
  }
  if(clickedName=="arduino"){
      py2block_editor.fromCode = true;
      sidecodeDisplay = false;
      sidecodeClick();
  }
  Blockly.fireUiEvent(window, 'resize');
}
/**
 * Populate the currently selected pane with content generated from the blocks.
 */
function renderContent() {
  var content = document.getElementById('content_' + selected);
  // Initialize the pane.
  if (content.id == 'content_blocks') {
    // If the workspace was changed by the XML tab, Firefox will have performed
    // an incomplete rendering due to Blockly being invisible.  Rerender.
      Blockly.mainWorkspace.render();
      var arduinoTextarea = document.getElementById('side_code');
      var code = Blockly.Python.workspaceToCode(Blockly.mainWorkspace) || '';
      //arduinoTextarea.value = code.replace(/(_[0-9A-F]{2}_[0-9A-F]{2}_[0-9A-F]{2})+/g, function (s) { return decodeURIComponent(s.replace(/_/g, '%')); });
      //editor_side_code.setValue(Blockly.Python.workspaceToCode(Blockly.mainWorkspace), -1);
     Blockly.Python.workspaceToCode(Blockly.mainWorkspace)
   
     } else if (content.id == 'content_xml') {
    var xmlTextarea = document.getElementById('content_xml');
    var xmlDom = Blockly.Xml.workspaceToDom(Blockly.mainWorkspace);
    var xmlText = Blockly.Xml.domToPrettyText(xmlDom);
    xmlTextarea.value = xmlText;
    xmlTextarea.focus();
  } else if (content.id == 'content_arduino') {
    //content.innerHTML = Blockly.Python.workspaceToCode(Blockly.mainWorkspace);
     var arduinoTextarea = document.getElementById('content_arduino');
   var code = Blockly.Python.workspaceToCode(Blockly.mainWorkspace) || '';
   var chinese_code = code.replace(/(_[0-9A-F]{2}_[0-9A-F]{2}_[0-9A-F]{2})+/g, function (s) { return decodeURIComponent(s.replace(/_/g, '%')); });
     editor.setValue(chinese_code, -1);
  
    //arduinoTextarea.focus();
  }
}
/**
 * Compute the absolute coordinates and dimensions of an HTML element.
 * @param {!Element} element Element to match.
 * @return {!Object} Contains height, width, x, and y properties.
 * @private
 */
function getBBox_(element) {
  var height = element.offsetHeight;
  var width = element.offsetWidth;
  var x = 0;
  var y = 0;
  do {
    x += element.offsetLeft;
    y += element.offsetTop;
    element = element.offsetParent;
  } while (element);
  return {
    height: height,
    width: width,
    x: x,
    y: y
  };
}
/**
 * Initialize Blockly.  Called on page load.
 */
var editor;
var editor;
var EditorRange;
var pyengine;
var py2block_editor;
function init() {
  //window.onbeforeunload = function() {
  //  return 'Leaving this page will result in the loss of your work.';
  //};
      ace.require("ace/ext/language_tools");
      editor = ace.edit("content_arduino");
      editor.setTheme("ace/theme/xcode");
      editor.getSession().setMode("ace/mode/turtle");
      editor.setFontSize(17);
      editor.setShowPrintMargin(false);
      editor.setOptions({
          enableBasicAutocompletion: true,
          enableSnippets: true,
          enableLiveAutocompletion: true
      });
      EditorRange = ace.require('ace/range').Range;
      editor.hasMarker = false;
      editor.session.on('change', function() {
          if(editor.hasMarker === true){
              editor.hasMarker = false;
              for(var mid in editor.session.$backMarkers){
                  if(editor.session.$backMarkers[mid]['clazz'] == 'errorMarker')
                      editor.session.removeMarker(mid);
              }
          }
      });
      editor.setScrollSpeed(0.05);
      var mixpyProject = new MixpyProject();
      pyengine = new PyEngine({}, mixpyProject);
      var py2block_converter = new PythonToBlocks();
      py2block_editor = new Py2blockEditor(py2block_converter, editor);
      Sk.python3 = true;
  var container = document.getElementById('content_area');
  var onresize = function(e) {
    var bBox = getBBox_(container);
    for (var i = 0; i < TABS_.length; i++) {
      var el = document.getElementById('content_' + TABS_[i]);
      el.style.top = bBox.y + 'px';
      el.style.left = bBox.x + 'px';
      // Height and width need to be set, read back, then set again to
      // compensate for scrollbars.
      el.style.height = bBox.height + 'px';
      el.style.height = (2 * bBox.height - el.offsetHeight) + 'px';
      el.style.width = bBox.width + 'px';
      el.style.width = (2 * bBox.width - el.offsetWidth) + 'px';
    }
    // Make the 'Blocks' tab line up with the toolbox.
    if (Blockly.mainWorkspace.toolbox_.width) {
      document.getElementById('tab_blocks').style.minWidth =
          (Blockly.mainWorkspace.toolbox_.width - 38) + 'px';
          // Account for the 19 pixel margin and on each side.
    }
  };
  window.addEventListener('resize', onresize, false);
  var toolbox = document.getElementById('toolbox');
  var masterWorkspace = Blockly.inject(document.getElementById('content_blocks'),
    {//grid:
        //{spacing: 25,
          //length: 3,
          //colour: '#ccc',
          //snap: true},
    media: '../../media/',
      toolbox: toolbox,
    zoom:
          {controls: true,
          wheel: true}
    });
    onresize();
  //实时更新右侧对比代码
    masterWorkspace.addChangeListener(rightCodeEvent);
  function rightCodeEvent(masterEvent) {
    if (masterEvent.type == Blockly.Events.UI) {
    return;  // Don't update UI events.
    }
    //更新
    var arduinoTextarea = document.getElementById('side_code');
    //var code = Blockly.Python.workspaceToCode(Blockly.mainWorkspace) || '';
    //arduinoTextarea.value = code.replace(/(_[0-9A-F]{2}_[0-9A-F]{2}_[0-9A-F]{2})+/g, function (s) { return decodeURIComponent(s.replace(/_/g, '%')); });
      //editor_side_code.setValue(Blockly.Python.workspaceToCode(Blockly.mainWorkspace), -1);
      Blockly.Python.workspaceToCode(Blockly.mainWorkspace);
  }
  
  auto_save_and_restore_blocks();
  //load from url parameter (single param)
  //http://stackoverflow.com/questions/2090551/parse-query-string-in-javascript
  var dest = unescape(location.search.replace(/^.*\=/, '')).replace(/\+/g, " ");
  if(dest){
    load_by_url(dest);
  }
  
  sidecodeClick();
}
</script>
</head>
<body onload="init()">
  <table height="100%" width="100%" id="table_whole">
    <tr>
      <td colspan=3>
        <table width="100%">
          <tr id="tabRow" height="1em">
            <td style="vertical-align: center;" id="tab_blocks" class="tabon" onclick="tabClick('blocks')"><img style="vertical-align:middle" width="25" src="media/blocks.png" /><span id="span_blocks">Blocks</span></td>
            <td class="tabmin">&nbsp;</td>
            <td style="vertical-align: center;text-align:center;" id="tab_arduino" class="taboff" onclick="tabClick('arduino')"><span id="span_arduino">Code</span></td>
            <td class="tabmin">&nbsp;</td>
            <td style="vertical-align: center;text-align:center;display:none;" id="tab_xml" class="taboff" onclick="tabClick('xml')">XML</td>
            <td class="tabcoyright">
              <span id="copyright" style=" font-family: 'Microsoft Yahei Light';font-size:12px;color:#999;">copyright</span>
            </td>
            <td class="tabmode">
              <span class="viewLeft" id="viewMode1" style=" font-family: 'Microsoft Yahei Light';;font-size:12px;">普通视图</span><a class="viewRight" id="viewMode2" href="index_advance_board_microbit%5Bjs%5D.html" style=" font-family: 'Microsoft Yahei Light';font-size:12px;">高级视图</a>
              <button onclick="pyengine.run();">运行</button>
              <button onclick="pyengine.kill();">取消</button>
              <input id="loading" src="media/loading.svg" type="image" height="17px" style="display: none;margin-top:10px;"></input>
            </td>
            <!--  <script type="text/javascript">
        var viewMode2 = document.getElementById('viewMode2');
        viewMode2.href = 'index_advance_board_microbit[js].html?lang='+Code.LANG;
              </script>-->
            <td class="tabmin">
              <input onclick="Blockly.mainWorkspace.undo(0);" name="undo" type="image" title="undo(ctrl+z)" src="media/undo.png" style="padding:5px;" onmouseover="this.src='media/undo1.png'" onmousedown="this.src='media/undo2.png'" onmouseup="this.src='media/undo1.png'" onmouseout="this.src='media/undo.png'" width="20" height="20" border="0">
            </td>
            <td class="tabmin" style="padding-right:20px">
              <input onclick="Blockly.mainWorkspace.undo(1);" name="redo" type="image" title="redo(ctrl+y)" src="media/redo.png" style="padding:5px" onmouseover="this.src='media/redo1.png'" onmousedown="this.src='media/redo2.png'" onmouseup="this.src='media/redo1.png'" onmouseout="this.src='media/redo.png'" width="20" height="20" border="0">
            </td>
            <td class="tabmin" style="padding-right:20px;display:none;">
              <button id="fakeload">LoadXML</button>
              <input type="file" id="load" style="display: none;" />
            </td>
            <td class="tabmin">
              <select id="languageMenu"></select>
            </td>
            <script>
              document.getElementById('span_blocks').textContent = MSG['tab_blocks'];
      document.getElementById('span_arduino').textContent = MSG['tab_arduino'];
      </script>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td height="100%" width="65%" id="content_area"></td>
      <td style="display:none;height:100%;width:0.4%;background: #ddd;cursor: w-resize;" id="mid_td"></td>
      <td width="34%" style="background-color:#eee;display:none;" id="side_code_parent">
        <div id="side_code_top" wrap="off" style="height:55%;">
          <div id="mat_div" wrap="off" style="position: relative;height:0%;background:#f9f9f9;outline: none;overflow:auto">
            <img id="matplot_img">
          </div>
          <div id="output_img" wrap="off" readonly style="position: relative;height:100%;background:#f9f9f9;outline: none;overflow:auto"></div>
          
        </div>
        <div id="side_code_mid"></div>
        <div id="side_code_bottom" style="height:44%;position:relative">
          <div style="top: 0px; left: 0px; right: 0px; bottom: 0px; position: absolute;">
            <pre id="side_code" class="content" readonly></pre>
          </div>
          <input src='media/ban.png' type='image' id="reset_output" onclick="clearOutput();"></input>
        </div>
      </td>
      <div id="sidebar" class="right-top" onclick="sidecodeClick()" style="display:none"></div>
    </tr>
  </table>
  <div id="content_blocks" class="content"></div>
  <div id="content_arduino" class="content" wrap="off"></div>
  <!-- <div id="content_arduino2" wrap="off" ></div> -->
  <textarea id="content_xml" class="content" wrap="off" readonly></textarea>
  <xml id="toolbox" style="display: none">
    <category name="" id="catInOut" colour="20">
      <!--      <block type="inout_input">
              <value name="VAR">
                  <shadow type="text">
                      <field name="TEXT">prompt</field>
                  </shadow>
              </value>
          </block>-->
      <block type="inout_type_input">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">prompt</field>
          </shadow>
        </value>
      </block>
      <block type="inout_print">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">Hello</field>
          </shadow>
        </value>
      </block>
      <block type="inout_print_inline">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">Hello</field>
          </shadow>
        </value>
      </block>
      <block type="inout_print_end">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">Hello</field>
          </shadow>
        </value>
        <value name="END">
          <shadow type="text">
            <field name="TEXT">,</field>
          </shadow>
        </value>
      </block>
      <block type="inout_print_many">
        <mutation items="2"></mutation>
        <value name="ADD0">
          <block type="text">
            <field name="TEXT">Hello</field>
          </block>
        </value>
        <value name="ADD1">
          <block type="text">
            <field name="TEXT">Mixly</field>
          </block>
        </value>
      </block>
      <!-- <block type="raw_block"></block> -->
    </category>
    <category id="catControl" colour="120">
      <block type="controls_end_program"></block>
      <!-- <block type="controls_type">
              <value name="DATA">
                  <shadow type="math_number">
                      <field name="NUM">1000</field>
                  </shadow>
              </value>
          </block>-->
      <block type="controls_pass"></block>
      <block type="controls_if"></block>
      <block type="controls_range">
        <value name="FROM">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
        <value name="TO">
          <shadow type="math_number">
            <field name="NUM">5</field>
          </shadow>
        </value>
        <value name="STEP">
          <shadow type="math_number">
            <field name="NUM">1</field>
          </shadow>
        </value>
      </block>
      <block type="controls_forEach">
        <value name="LIST">
          <shadow type="list_many_input">
            <field name="CONTENT">0,1,2,3</field>
          </shadow>
          <block type="controls_range">
            <value name="FROM">
              <shadow type="math_number">
                <field name="NUM">0</field>
              </shadow>
            </value>
            <value name="TO">
              <shadow type="math_number">
                <field name="NUM">5</field>
              </shadow>
            </value>
            <value name="STEP">
              <shadow type="math_number">
                <field name="NUM">1</field>
              </shadow>
            </value>
          </block>
        </value>
        <value name="VAR">
          <shadow type="variables_get">
            <field name="VAR">i</field>
          </shadow>
        </value>
      </block>
      <block type="controls_whileUntil">
        <value name="BOOL">
          <shadow type="logic_boolean">
          </shadow>
        </value>
      </block>
      <block type="controls_try_finally"></block>
      <!--0    <block type="controls_repeat_ext">
              <value name="TIMES">
                  <shadow type="math_number">
                      <field name="NUM">10</field>
                  </shadow>
              </value>
          </block>-->
      <block type="controls_flow_statements"></block>
      <block type="controls_millis"></block>
      <block type="time_localtime"></block>
      <!--   <block type="Panic_with_status_code">
            <value name="STATUS_CODE">
                  <shadow type="math_number">
                      <field name="NUM">404</field>
                  </shadow>
              </value>
          </block>
          <block type="reset"></block>-->
    </category>
    <category id="catMath" colour="230">
      <block type="math_number"></block>
      <block type="math_constant"></block>
      <block type="math_trig">
        <value name="NUM">
          <shadow type="math_number">
            <field name="NUM">90</field>
          </shadow>
        </value>
      </block>
      <block type="text_to_number">
        <value name="VAR">
          <shadow type="variables_get">
            <field name="VAR">x</field>
          </shadow>
        </value>
      </block>
      <block type="math_dec">
        <value name="NUM">
          <shadow type="math_number">
            <field name="NUM">15</field>
          </shadow>
        </value>
      </block>
      <block type="math_arithmetic">
        <value name="A">
          <shadow type="math_number">
            <field name="NUM">1</field>
          </shadow>
        </value>
        <value name="B">
          <shadow type="math_number">
            <field name="NUM">1</field>
          </shadow>
        </value>
      </block>      
      <block type="math_bit">
        <value name="A">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
        <value name="B">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>
      <block type="math_selfcalcu">
        <value name="A">
          <shadow type="variables_get">
            <field name="VAR">a</field>
          </shadow>
        </value>
        <value name="B">
          <shadow type="math_number">
            <field name="NUM">1</field>
          </shadow>
        </value>
      </block>
      <block type="math_to_int">
        <value name="A">
          <shadow type="math_number">
            <field name="NUM">0.998</field>
          </shadow>
        </value>
      </block>      
      <block type="math_max_min">
        <value name="A">
          <shadow type="math_number">
            <field name="NUM">1</field>
          </shadow>
        </value>
        <value name="B">
          <shadow type="math_number">
            <field name="NUM">2</field>
          </shadow>
        </value>
      </block>
      <block type="math_round">
        <value name="VALUE">
          <shadow type="math_number">
            <field name="NUM">4.8</field>
          </shadow>
        </value>
        <value name="VAR">
          <shadow type="math_number">
            <field name="NUM">2</field>
          </shadow>
        </value>        
      </block>
      <block type="math_random">
        <value name="FROM">
          <shadow type="math_number">
            <field name="NUM">1</field>
          </shadow>
        </value>
        <value name="TO">
          <shadow type="math_number">
            <field name="NUM">100</field>
          </shadow>
        </value>
      </block>
      <block type="math_number_base_conversion">
        <value name="NUM">
          <shadow type="math_number">
            <field name="NUM">1010</field>
          </shadow>
      </block>
      <block type="math_constrain">
        <value name="VALUE">
          <shadow type="math_number">
            <field name="NUM">1000</field>
          </shadow>
        </value>
        <value name="LOW">
          <shadow type="math_number">
            <field name="NUM">1</field>
          </shadow>
        </value>
        <value name="HIGH">
          <shadow type="math_number">
            <field name="NUM">100</field>
          </shadow>
        </value>
      </block>
      <block type="math_map">
        <value name="NUM">
          <shadow type="math_number">
            <field name="NUM">50</field>
          </shadow>
        </value>
        <value name="fromLow">
          <shadow type="math_number">
            <field name="NUM">1</field>
          </shadow>
        </value>
        <value name="fromHigh">
          <shadow type="math_number">
            <field name="NUM">100</field>
          </shadow>
        </value>
        <value name="toLow">
          <shadow type="math_number">
            <field name="NUM">1</field>
          </shadow>
        </value>
        <value name="toHigh">
          <shadow type="math_number">
            <field name="NUM">1000</field>
          </shadow>
        </value>
      </block>
      
    </category>
    <category id="catLogic" colour="210">
      <block type="logic_compare"></block>
      <block type="logic_compare_continous">
        <value name="A">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
        <value name="B">
          <shadow type="variables_get">
            <field name="VAR">x</field>
          </shadow>
        </value>
        <value name="C">
          <shadow type="math_number">
            <field name="NUM">2</field>
          </shadow>
        </value>
      </block>
      <block type="logic_operation"></block>
      <block type="logic_negate"></block>
      <block type="logic_boolean"></block>
      <block type="logic_null"></block>
      <block type="logic_true_or_false"></block>
      <block type="logic_is_in">
        <value name="A">
          <shadow type="variables_get">
            <field name="VAR">x</field>
          </shadow>
        </value>
        <value name="B">
          <shadow type="list_many_input">
            <field name="CONTENT">0,1,2,3</field>
          </shadow>
        </value>
      </block>
      <block type="logic_is">
        <value name="A">
          <shadow type="list_many_input">
            <field name="CONTENT">0,1,2,3</field>
          </shadow>
        </value>
        <value name="B">
          <shadow type="list_many_input">
            <field name="CONTENT">0,1,2,3</field>
          </shadow>
        </value>
      </block>
      <block type="logic_tobool">
        <value name="VAR">
          <shadow type="variables_get">
            <field name="VAR">x</field>
          </shadow>
        </value>
      </block>
    </category>
    <category id="catText" colour="160">
      <block type="text">
        <field name="TEXT">Mixly</field>
      </block>
      <block type="text_textarea">
      </block>      
      <block type="text_join">
        <value name="A">
          <shadow type="text">
            <field name="TEXT">Hello</field>
          </shadow>
        </value>
        <value name="B">
          <shadow type="text">
            <field name="TEXT">Mixly</field>
          </shadow>
        </value>
      </block>
      
      <block type="ascii_to_char">
        <value name="VAR">
          <shadow type="math_number">
            <field name="NUM">65</field>
          </shadow>
        </value>
      </block>
      <block type="char_to_ascii">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">a</field>
          </shadow>
        </value>
      </block>
      <block type="number_to_text">
        <value name="VAR">
          <shadow type="variables_get">
            <field name="VAR">x</field>
          </shadow>
        </value>
      </block>
      <block type="text_length">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">Mixly</field>
          </shadow>
        </value>
      </block>     
      <block type="text_equals_starts_ends">
        <value name="STR1">
          <shadow type="text">
            <field name="TEXT"></field>
          </shadow>
        </value>
        <value name="STR2">
          <shadow type="text">
            <field name="TEXT"></field>
          </shadow>
        </value>
      </block> 
      <block type="text_char_at">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">Mixly</field>
          </shadow>
        </value>
        <value name="AT">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>     
      <block type="text_substring">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">Mixly</field>
          </shadow>
        </value>
        <value name="AT1">
          <shadow type="math_indexer_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
        <value name="AT2">
          <shadow type="math_indexer_number">
            <field name="NUM">2</field>
          </shadow>
        </value>
      </block>
      <block type="text_random_char">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">Mixly</field>
          </shadow>
        </value>
      </block>
      <block type="text_encode">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">Mixly</field>
          </shadow>
        </value>
      </block>
      <block type="text_capital">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">Hello,mixly</field>
          </shadow>
        </value>
      </block>
      <block type="text_center">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">Hello,mixly</field>
          </shadow>
        </value>
        <value name="WID">
          <shadow type="math_number">
            <field name="NUM">50</field>
          </shadow>
        </value>
        <value name="Symbol">
          <shadow type="text">
            <field name="TEXT">*</field>
          </shadow>
        </value>
      </block>
      <block type="text_find">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">Hello,mixly</field>
          </shadow>
        </value>
        <value name="STR">
          <shadow type="text">
            <field name="TEXT">l</field>
          </shadow>
        </value>
      </block>
      <block type="text_join_seq">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">--</field>
          </shadow>
        </value>
        <value name="LIST">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
      </block>
      <block type="text_replace">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">Hello,mixly</field>
          </shadow>
        </value>
        <value name="STR1">
          <shadow type="text">
            <field name="TEXT">mixly</field>
          </shadow>
        </value>
        <value name="STR2">
          <shadow type="text">
            <field name="TEXT">mixpy</field>
          </shadow>
        </value>
      </block>
      <block type="text_split">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">I love mixly！</field>
          </shadow>
        </value>
        <value name="VAL">
          <shadow type="text">
            <field name="TEXT"> </field>
          </shadow>
        </value>
      </block>
      <block type="text_strip">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT"> I love mixly </field>
          </shadow>
        </value>
      </block>
      <block type="text_format_noreturn">
        <mutation items="1"></mutation>
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">Random No. is {}</field>
          </shadow>
        </value>
        <value name="ADD0">
          <block type="math_random">
            <field name="TYPE">int</field>
            <value name="FROM">
              <shadow type="math_number">
                <field name="NUM">1</field>
              </shadow>
            </value>
            <value name="TO">
              <shadow type="math_number">
                <field name="NUM">100</field>
              </shadow>
            </value>
          </block>
        </value>
      </block>
      <block type="text_eval">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">input('1+2*3')</field>
          </shadow>
        </value>
      </block>
      <block type="os_system">
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">dir</field>
          </shadow>
        </value>
      </block>
    </category>
    <category id="catMicropyLists" colour="260">
      <block type="lists_create_with"></block>
      <block type="lists_create_with_noreturn"></block>
      <block type="variables_set">        
        <field name="VAR">mylist</field>
        <value name="VALUE">
          <block type="list_many_input">
            <field name="CONTENT">1,2,3,4,5</field>
          </block>
        </value>
      </block>
      <!--<block type="lists_create_with_text"></block>  -->    
      <block type="lists_get_index">
        <value name="LIST">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
        <value name="AT">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>
      <block type="lists_get_sublist">
        <value name="LIST">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
        <value name="AT1">
          <shadow type="math_indexer_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
        <value name="AT2">
          <shadow type="math_indexer_number">
            <field name="NUM">2</field>
          </shadow>
        </value>
      </block>
      <block type="lists_2d_get_data_with_col_row">
        <value name="LIST">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
        <value name="row">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
        <value name="col">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>
      <block type="lists_2d_get_col_row_data">
        <value name="LIST">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
        <value name="row_start">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
        <value name="row_end">
          <shadow type="math_number">
            <field name="NUM">1</field>
          </shadow>
        </value>
        <value name="col_start">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
        <value name="col_end">
          <shadow type="math_number">
            <field name="NUM">1</field>
          </shadow>
        </value>
      </block>
      <block type="lists_get_random_item">
        <value name="LIST">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
      </block>
      <block type="lists_get_random_sublist">
        <value name="LIST">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
        <value name="VAR">
          <shadow type="math_number">
            <field name="NUM">2</field>
          </shadow>
        </value>
      </block>
      <block type="list_trig">
        <value name="data">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
      </block>
      <block type="lists_find">
        <value name="VAR">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
        <value name="data">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>
      <block type="lists_set_index">
        <value name="LIST">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
        <value name="AT">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
        <value name="TO">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>
      <block type="lists_insert_value">
        <value name="LIST">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
        <value name="AT">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
        <value name="VALUE">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>
      <block type="lists_append_extend">
        <value name="LIST">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
        <value name="DATA">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>
      <block type="lists_remove_at">
        <value name="LIST">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
        <value name="DATA">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>
      <block type="lists_pop">
        <value name="LIST">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
        <value name="VALUE">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>        
      <block type="lists_sort">
        <value name="LIST">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
      </block>
      <block type="lists_reverse">
        <value name="VAR">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
      </block>
      <block type="lists_clear">
        <value name="VAR">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
      </block>
      <!--<block type="lists_change_to">
        <value name="VAR">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
      </block>-->
      <block type="list_tolist">
        <value name="VAR">
          <shadow type="variables_get">
            <field name="VAR">x</field>
          </shadow>
        </value>
      </block>
      <block type="lists_zip">
        <mutation items="2"></mutation>
        <value name="ADD0">
          <block type="list_many_input">
            <field name="CONTENT">0,1,2,3</field>
          </block>
        </value>
        <value name="ADD1">
          <block type="list_many_input">
            <field name="CONTENT">0,1,2,3</field>
          </block>
        </value>
      </block>
    </category>
    <category id="catTuple" colour="195">
      <block type="tuple_create_with"></block>
      <block type="variables_set">        
        <field name="VAR">mytup</field>
        <value name="VALUE">
          <block type="tuple_create_with_text_return">
            <field name="TEXT">1,2,3,4,5</field>
          </block>
        </value>
      </block>
      <!--<block type="tuple_create_with_text2"></block>-->
      <block type="tuple_getIndex">
        <value name="TUP">
          <shadow type="variables_get">
            <field name="VAR">mytup</field>
          </shadow>
        </value>
        <value name="AT">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>
      <block type="tuple_get_sublist">
        <value name="LIST">
          <shadow type="variables_get">
            <field name="VAR">mytup</field>
          </shadow>
        </value>
        <value name="AT1">
          <shadow type="math_indexer_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
        <value name="AT2">
          <shadow type="math_indexer_number">
            <field name="NUM">2</field>
          </shadow>
        </value>
      </block>
      <block type="tuple_get_random_item">
        <value name="TUP">
          <shadow type="variables_get">
            <field name="VAR">mytup</field>
          </shadow>
        </value>
      </block>
      <block type="tuple_length">
        <value name="TUP">
          <shadow type="variables_get">
            <field name="VAR">mytup</field>
          </shadow>
        </value>
      </block>
      <block type="tuple_max">
        <value name="TUP">
          <shadow type="variables_get">
            <field name="VAR">mytup</field>
          </shadow>
        </value>
      </block>
      <block type="tuple_del">
        <value name="TUP">
          <shadow type="variables_get">
            <field name="VAR">mytup</field>
          </shadow>
        </value>
      </block>
      <block type="tuple_join">
        <value name="TUP1">
          <shadow type="variables_get">
            <field name="VAR">mytup1</field>
          </shadow>
        </value>
        <value name="TUP2">
          <shadow type="variables_get">
            <field name="VAR">mytup2</field>
          </shadow>
        </value>
      </block>
      <!--<block type="tuple_change_to">
        <value name="VAR">
          <shadow type="variables_get">
            <field name="VAR">mytup</field>
          </shadow>
        </value>
      </block>-->
      <block type="tuple_totuple">
        <value name="VAR">
          <shadow type="variables_get">
            <field name="VAR">x</field>
          </shadow>
        </value>
      </block>
    </category>
    <category id="catDicts" colour="345">
      <block type="dicts_create_with"></block>
      <block type="dicts_keys">
        <value name="DICT">
          <shadow type="variables_get">
            <field name="VAR">mydict</field>
          </shadow>
        </value>
      </block>
      <block type="dicts_get">
        <value name="DICT">
          <shadow type="variables_get">
            <field name="VAR">mydict</field>
          </shadow>
        </value>
        <value name="KEY">
          <shadow type="text">
            <field name="TEXT">key</field>
          </shadow>
        </value>
      </block>
      <block type="dicts_get_default">
        <value name="DICT">
          <shadow type="variables_get">
            <field name="VAR">mydict</field>
          </shadow>
        </value>
        <value name="KEY">
          <shadow type="text">
            <field name="TEXT">key</field>
          </shadow>
        </value>
        <value name="VAR">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>
      <block type="dicts_add_or_change">
        <value name="DICT">
          <shadow type="variables_get">
            <field name="VAR">mydict</field>
          </shadow>
        </value>
        <value name="KEY">
          <shadow type="text">
            <field name="TEXT">key</field>
          </shadow>
        </value>
        <value name="VAR">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>
      <block type="dicts_delete">
        <value name="DICT">
          <shadow type="variables_get">
            <field name="VAR">mydict</field>
          </shadow>
        </value>
        <value name="KEY">
          <shadow type="text">
            <field name="TEXT">key</field>
          </shadow>
        </value>
      </block>
      <block type="dicts_pop">
        <value name="DICT">
          <shadow type="variables_get">
            <field name="VAR">mydict</field>
          </shadow>
        </value>
        <value name="KEY">
          <shadow type="text">
            <field name="TEXT">key</field>
          </shadow>
        </value>
      </block>
      <block type="dicts_setdefault">
        <value name="DICT">
          <shadow type="variables_get">
            <field name="VAR">mydict</field>
          </shadow>
        </value>
        <value name="KEY">
          <shadow type="text">
            <field name="TEXT">key</field>
          </shadow>
        </value>
        <value name="VAR">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>
      <block type="dicts_clear">
        <value name="DICT">
          <shadow type="variables_get">
            <field name="VAR">mydict</field>
          </shadow>
        </value>
      </block>
      <!--<block type="dicts_items">
        <value name="DICT">
          <shadow type="variables_get">
            <field name="VAR">mydict</field>
          </shadow>
        </value>
      </block>-->
      <block type="dicts_values">
        <value name="DICT">
          <shadow type="variables_get">
            <field name="VAR">mydict</field>
          </shadow>
        </value>
      </block>
      <block type="dicts_length">
        <value name="DICT">
          <shadow type="variables_get">
            <field name="VAR">mydict</field>
          </shadow>
        </value>
      </block>
      <block type="dicts_deldict">
        <value name="DICT">
          <shadow type="variables_get">
            <field name="VAR">mydict</field>
          </shadow>
        </value>
      </block>
      <block type="dicts_todict">
        <value name="VAR">
          <shadow type="variables_get">
            <field name="VAR">x</field>
          </shadow>
        </value>
      </block>
    </category>
    <category id="catSet" colour="100">
      <block type="set_create_with"></block>
      <block type="variables_set">        
        <field name="VAR">s1</field>
        <value name="VALUE">
          <block type="set_create_with_text_return">
            <field name="TEXT">1,2,3,4,5</field>
          </block>
        </value>
      </block>
      <block type="set_length">
        <value name="SET">
          <shadow type="variables_get">
            <field name="VAR">s1</field>
          </shadow>
        </value>
      </block>
      <block type="set_pop">
        <value name="SET">
          <shadow type="variables_get">
            <field name="VAR">s1</field>
          </shadow>
        </value>
      </block>
      <block type="set_operate">
        <value name="SET1">
          <shadow type="variables_get">
            <field name="VAR">s1</field>
          </shadow>
        </value>
        <value name="SET2">
          <shadow type="variables_get">
            <field name="VAR">s2</field>
          </shadow>
        </value>
      </block>
      <block type="set_operate_update">
        <value name="SET1">
          <shadow type="variables_get">
            <field name="VAR">s1</field>
          </shadow>
        </value>
        <value name="SET2">
          <shadow type="variables_get">
            <field name="VAR">s2</field>
          </shadow>
        </value>
      </block>
      <block type="set_add_discard">
        <value name="SET">
          <shadow type="variables_get">
            <field name="VAR">s1</field>
          </shadow>
        </value>
        <value name="data">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>
      <block type="set_update">
        <value name="SET">
          <shadow type="variables_get">
            <field name="VAR">s1</field>
          </shadow>
        </value>
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">Mixly</field>
          </shadow>
        </value>
      </block>
      <block type="set_sub">
        <value name="SET1">
          <shadow type="variables_get">
            <field name="VAR">s1</field>
          </shadow>
        </value>
        <value name="SET2">
          <shadow type="variables_get">
            <field name="VAR">s2</field>
          </shadow>
        </value>
      </block>
      <block type="set_toset">
        <value name="VAR">
          <shadow type="variables_get">
            <field name="VAR">x</field>
          </shadow>
        </value>
      </block>
    </category>
    <category id="catVar" colour="330" custom="VARIABLE">
    </category>
    <category id="catFun" custom="PROCEDURE" colour="290"></category>
    <category id="catTurtle" colour="180">
      <block type="turtle_create"></block>
      <block type="turtle_move">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
        <value name="VAR">
          <shadow type="math_number">
            <field name="NUM">20</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_rotate">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
        <value name="VAR">
          <shadow type="math_number">
            <field name="NUM">90</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_setheading">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
        <value name="data">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_goto">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
        <value name="data">
          <shadow type="math_number">
            <field name="NUM">20</field>
          </shadow>
        </value>
        <value name="val">
          <shadow type="math_number">
            <field name="NUM">20</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_setxy">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
        <value name="VAR">
          <shadow type="math_number">
            <field name="NUM">50</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_pos_shape">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_clear">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_penup">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
      </block>
      <!--      <block type="turtle_size_speed">
              <value name="VAR">
                  <shadow type="math_number">
                      <field name="NUM">5</field>
                  </shadow>
              </value>
          </block>-->
      <block type="turtle_size">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
        <value name="data">
          <shadow type="math_number">
            <field name="NUM">5</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_shape">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_speed">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
        <value name="data">
          <shadow type="math_number">
            <field name="NUM">5</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_circle">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
        <value name="VAR">
          <shadow type="math_number">
            <field name="NUM">50</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_circle_advanced">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
        <value name="VAR">
          <shadow type="math_number">
            <field name="NUM">50</field>
          </shadow>
        </value>
        <value name="data">
          <shadow type="math_number">
            <field name="NUM">360</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_clone">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_visible">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_write">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">Mixly!</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_write_format_skulpt">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">Mixly!</field>
        </value>
        <value name="FONTNAME">
          <shadow type="text">
            <field name="TEXT">Arial</field>
        </value>
        <value name="FONTNUM">
          <shadow type="math_number">
            <field name="NUM">8</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_pencolor_hex_new">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
        <value name="VAR">
          <block type="turtle_color_seclet" >
            <field name="COLOR">#ff0000</field>
          </block>
          <shadow type="text">
            <field name="TEXT">#FF0000</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_fillcolor_hex_new">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
        <value name="VAR">
          <block type="turtle_color_seclet" >
            <field name="COLOR">#ff0000</field>
          </block>
          <shadow type="text">
            <field name="TEXT">#FF0000</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_color_hex">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
        <value name="VAR1">
          <block type="turtle_color_seclet" >
            <field name="COLOR">#ff0000</field>
          </block>
          <shadow type="text">
            <field name="TEXT">#FF0000</field>
          </shadow>
        </value>
        <value name="VAR2">
          <block type="turtle_color_seclet" >
            <field name="COLOR">#ff0000</field>
          </block>
          <shadow type="text">
            <field name="TEXT">#FF0000</field>
          </shadow>
        </value>
      </block>
      <!--<block type="turtle_pencolor">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_fillcolor">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
      </block>-->
      <!--<block type="turtle_bgcolor_hex">
            <value name="VAR">
                  <shadow type="text">
                      <field name="TEXT">FF0000</field>
                  </shadow>
              </value>
          </block>-->
      <block type="turtle_pencolor_hex">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">#FF0000</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_fillcolor_hex">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
        <value name="VAR">
          <shadow type="text">
            <field name="TEXT">#FF0000</field>
          </shadow>
        </value>
      </block>
      <block type="turtle_fill">
        <value name="TUR">
          <shadow type="variables_get">
            <field name="VAR">tina</field>
          </shadow>
        </value>
      </block>
    </category>
    <category id="catData" colour="170">
      <block type="variables_set">        
        <field name="VAR">df1</field>
        <value name="VALUE">
          <block type="pandas_readcsv">
        <value name="FILENAME">
          <shadow type="text">
            <field name="TEXT">data.csv</field>
          </shadow>
        </value>
      </block>
        </value>
      </block>
      
      <block type="variables_set">        
        <field name="VAR">x</field>
        <value name="VALUE">
          <block type="array_create">
        <value name="FROM">
          <shadow type="math_number">
            <field name="NUM">1.5</field>
          </shadow>
        </value>
        <value name="TO">
          <shadow type="math_number">
            <field name="NUM">5.5</field>
          </shadow>
        </value>
        <value name="STEP">
          <shadow type="math_number">
            <field name="NUM">0.5</field>
          </shadow>
        </value>
      </block>
        </value>
      </block>
      <block type="array_toarray">
        <value name="VAR">
          <shadow type="list_many_input">
            <field name="CONTENT">0,1,2,3</field>
          </shadow>
        </value>
      </block>
      <block type="numpy_trig">
        <value name="NUM">
          <shadow type="variables_get">
            <field name="VAR">x</field>
          </shadow>
        </value>
      </block>
      <block type="series_create">
        <value name="SER">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
      </block>
      <block type="series_create_from_index">
        <value name="SER">
          <shadow type="variables_get">
            <field name="VAR">mylist</field>
          </shadow>
        </value>
        <value name="INDEX">
          <shadow type="list_many_input">
            <field name="CONTENT">0,1,2,3</field>
          </shadow>
        </value>
      </block>
      <!--<block type="series_create_from_text"></block>-->
      <block type="dataframe_create">
        <value name="SER">
          <shadow type="variables_get">
            <field name="VAR">mydict</field>
          </shadow>
        </value>
      </block>
      <block type="dataframe_create_from_one_index">
        <value name="SER">
          <shadow type="variables_get">
            <field name="VAR">mydict</field>
          </shadow>
        </value>
        <value name="INDEX">
          <shadow type="list_many_input">
            <field name="CONTENT">'a','b','c','d'</field>
          </shadow>
        </value>
      </block>
      <block type="dataframe_create_from_index">
        <value name="SER">
          <shadow type="variables_get">
            <field name="VAR">mydict</field>
          </shadow>
        </value>
        <value name="INDEX_COLUMN">
          <shadow type="list_many_input">
            <field name="CONTENT">'ABCD'</field>
          </shadow>
        </value>
        <value name="INDEX_RAW">
          <shadow type="list_many_input">
            <field name="CONTENT">'a','b','c','d'</field>
          </shadow>
        </value>
      </block>
      <block type="series_index_value">
        <value name="SERIES">
          <shadow type="variables_get">
            <field name="VAR">ser1</field>
          </shadow>
        </value>
      </block>
      <block type="series_get_num">
        <value name="SER">
          <shadow type="variables_get">
            <field name="VAR">ser1</field>
          </shadow>
        </value>
        <value name="AT">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
      </block>      
      <block type="dataframe_get">
        <value name="DICT">
          <shadow type="variables_get">
            <field name="VAR">df1</field>
          </shadow>
        </value>
        <value name="KEY">
          <shadow type="text">
            <field name="TEXT">tag</field>
          </shadow>
        </value>
      </block>
      <block type="plot_plot_easy">
        <value name="SER">
          <shadow type="variables_get">
            <field name="VAR">ser1</field>
          </shadow>
        </value>
      </block>
      <block type="plot_plot">
        <value name="SER">
          <shadow type="variables_get">
            <field name="VAR">ser1</field>
          </shadow>
        </value>
      </block>
      <block type="plot_plot_bar">
        <value name="A">
          <shadow type="list_many_input">
            <field name="CONTENT">1,2,3,4</field>
          </shadow>
        </value>
        <value name="B">
          <shadow type="list_many_input">
            <field name="CONTENT">5,6,7,8</field>
          </shadow>
        </value>
      </block>
      <block type="plot_plot_scatter">
        <value name="A">
          <shadow type="list_many_input">
            <field name="CONTENT">1,2,3,4</field>
          </shadow>
        </value>
        <value name="B">
          <shadow type="list_many_input">
            <field name="CONTENT">5,6,7,8</field>
          </shadow>
        </value>
        <value name="S">
          <shadow type="list_many_input">
            <field name="CONTENT">20,20,20,20</field>
          </shadow>
        </value>
        <value name="TAG">
          <shadow type="text">
            <field name="TEXT">tag</field>
          </shadow>
        </value>
      </block>
      <block type="plot_plot_xy">
        <value name="A">
          <shadow type="list_many_input">
            <field name="CONTENT">1,2,3,4</field>
          </shadow>
        </value>
        <value name="B">
          <shadow type="list_many_input">
            <field name="CONTENT">5,6,7,8</field>
          </shadow>
        </value>
        <value name="TAG">
          <shadow type="text">
            <field name="TEXT">tag</field>
          </shadow>
        </value>
      </block>
      <block type="plot_bar">
        <value name="A">
          <shadow type="list_many_input">
            <field name="CONTENT">1,2,3,4</field>
          </shadow>
        </value>
        <value name="B">
          <shadow type="list_many_input">
            <field name="CONTENT">5,6,7,8</field>
          </shadow>
        </value>
        <value name="WIDTH">
          <shadow type="math_number">
            <field name="NUM">0.5</field>
          </shadow>
        </value>
        <value name="COLOR">
          <block type="turtle_color_seclet" >
            <field name="COLOR">#0000ff</field>
          </block>
        </value>
        <value name="TAG">
          <shadow type="text">
            <field name="TEXT">tag</field>
          </shadow>
        </value>
      </block>
      <block type="plot_pie">
        <value name="A">
          <shadow type="list_many_input">
            <field name="CONTENT">0.25,0.35,0.1,0.3</field>
          </shadow>
        </value>
        <value name="B">
          <shadow type="list_many_input">
            <field name="CONTENT">'a','b','c','d'</field>
          </shadow>
        </value>
        <value name="TAG">
          <shadow type="text">
            <field name="TEXT">tag</field>
          </shadow>
        </value>
        <value name="EXPLODE">
          <shadow type="list_many_input">
            <field name="CONTENT">0.2,0,0,0</field>
          </shadow>
        </value>
      </block>
      <block type="plot_hist">
        <value name="A">
          <shadow type="list_many_input">
            <field name="CONTENT">11,21,31,41,51,61,71,81,91</field>
          </shadow>
        </value>
        <value name="B">
          <shadow type="list_many_input">
            <field name="CONTENT">0,20,40,60,80,100</field>
          </shadow>
        </value>
      </block>
      <block type="plot_show"></block>
      <block type="plot_subplot">
        <value name="VET">
          <shadow type="math_number">
            <field name="NUM">2</field>
          </shadow>
        </value>
        <value name="HOR">
          <shadow type="math_number">
            <field name="NUM">1</field>
          </shadow>
        </value>
        <value name="NUM">
          <shadow type="math_number">
            <field name="NUM">1</field>
          </shadow>
        </value>
       </block> 
      <block type="plot_axes"></block> 
      <block type="plot_legend"></block>
      <block type="plot_title">
        <value name="TITLE">
          <shadow type="text">
            <field name="TEXT">Title</field>
          </shadow>
        </value>
      </block>
      <block type="plot_label">
        <value name="LABEL">
          <shadow type="text">
            <field name="TEXT">axis</field>
          </shadow>
        </value>
      </block>
      <block type="plot_ticks">
        <value name="A">
          <shadow type="list_many_input">
            <field name="CONTENT">1,2,3,4</field>
          </shadow>
        </value>
        <value name="B">
          <shadow type="list_many_input">
            <field name="CONTENT">1,2,3,4</field>
          </shadow>
        </value>
      </block>
      <block type="plot_text">
        <value name="VET">
          <shadow type="math_number">
            <field name="NUM">1</field>
          </shadow>
        </value>
        <value name="HOR">
          <shadow type="math_number">
            <field name="NUM">5</field>
          </shadow>
        </value>
        <value name="NUM">
          <shadow type="math_number">
            <field name="NUM">5</field>
          </shadow>
        </value>
        <value name="FONTNUM">
          <shadow type="math_number">
            <field name="NUM">8</field>
          </shadow>
        </value>
       </block>
      <block type="plot_savefig">
        <value name="FILE">
          <shadow type="text">
            <field name="TEXT">1.png</field>
          </shadow>
        </value>
      </block>

    </category>
    <category id="catsklearn" colour="80">
      <block type="sklearn_make_classification">
        <value name="n_samples">
          <shadow type="math_number">
            <field name="NUM">100</field>
          </shadow>
        </value>
        <value name="n_features">
          <shadow type="math_number">
            <field name="NUM">20</field>
          </shadow>
        </value>
        <value name="n_informative">
          <shadow type="math_number">
            <field name="NUM">2</field>
          </shadow>
        </value>
        <value name="n_redundant">
          <shadow type="math_number">
            <field name="NUM">2</field>
          </shadow>
        </value>
        <value name="n_repeated">
          <shadow type="math_number">
            <field name="NUM">0</field>
          </shadow>
        </value>
        <value name="n_classes">
          <shadow type="math_number">
            <field name="NUM">2</field>
          </shadow>
        </value>
        <value name="n_clusters_per_class">
          <shadow type="math_number">
            <field name="NUM">2</field>
          </shadow>
        </value>
        <value name="random_state">
          <shadow type="math_number">
            <field name="NUM">None</field>
          </shadow>
        </value>
      </block>
      <block type="sklearn_make_regression">
        <value name="n_samples">
          <shadow type="math_number">
            <field name="NUM">100</field>
          </shadow>
        </value>
        <value name="n_features">
          <shadow type="math_number">
            <field name="NUM">100</field>
          </shadow>
        </value>
        <value name="n_informative">
          <shadow type="math_number">
            <field name="NUM">10</field>
          </shadow>
        </value>
        <value name="n_targets">
          <shadow type="math_number">
            <field name="NUM">1</field>
          </shadow>
        </value>
        <value name="bias">
          <shadow type="math_number">
            <field name="NUM">0.0</field>
          </shadow>
        </value>
        <value name="noise">
          <shadow type="math_number">
            <field name="NUM">0.0</field>
          </shadow>
        </value>
        <value name="random_state">
          <shadow type="math_number">
            <field name="NUM">None</field>
          </shadow>
        </value>
      </block>
      <block type="sklearn_make_blobs">
        <value name="n_samples">
          <shadow type="math_number">
            <field name="NUM">100</field>
          </shadow>
        </value>
        <value name="n_features">
          <shadow type="math_number">
            <field name="NUM">2</field>
          </shadow>
        </value>
        <value name="centers">
          <shadow type="math_number">
            <field name="NUM">None</field>
          </shadow>
        </value>
        <value name="cluster_std">
          <shadow type="math_number">
            <field name="NUM">1.0</field>
          </shadow>
        </value>
        <value name="center_box">
          <block type="tuple_create_with_text_return">
            <field name="TEXT">-10.0,10.0</field>
          </block>
        </value>
        <value name="shuffle">
          <shadow type="logic_boolean">
            <field name="BOOL">TRUE</field>
          </shadow>
        </value>
        <value name="random_state">
          <shadow type="math_number">
            <field name="NUM">None</field>
          </shadow>
        </value>
      </block>
      <block type="sklearn_load">
      </block>
      <block type="sklearn_data_target">
        <value name="name">
          <shadow type="variables_get">
            <field name="VAR">iris</field>
          </shadow>
        </value>
      </block>
      <block type="sklearn_train_test_split">
        <value name="train_data">
          <shadow type="variables_get">
            <field name="VAR">iris_X</field>
          </shadow>
        </value>
        <value name="train_target">
          <shadow type="variables_get">
            <field name="VAR">iris_y</field>
          </shadow>
        </value>
        <value name="test_size">
          <shadow type="math_number">
            <field name="NUM">0.3</field>
          </shadow>
        </value>
        <value name="rondom_state">
          <shadow type="math_number">
            <field name="NUM">None</field>
          </shadow>
        </value>
      </block>
      <block type="sklearn_LinearRegression">
        <value name="model_name">
          <shadow type="variables_get">
            <field name="VAR">model</field>
          </shadow>
        </value>
        <value name="fit_intercept">
          <shadow type="logic_boolean">
            <field name="BOOL">TRUE</field>
          </shadow>
        </value>
        <value name="normalize">
          <shadow type="logic_boolean">
            <field name="BOOL">FALSE</field>
          </shadow>
        </value>
        <value name="n_jobs">
          <shadow type="math_number">
            <field name="NUM">None</field>
          </shadow>
        </value>
      </block>
      <block type="sklearn_Ridge">
        <value name="model_name">
          <shadow type="variables_get">
            <field name="VAR">model</field>
          </shadow>
        </value>
        <value name="alpha">
          <shadow type="math_number">
            <field name="NUM">1.0</field>
          </shadow>
        </value>
        <value name="fit_intercept">
          <shadow type="logic_boolean">
            <field name="BOOL">TRUE</field>
          </shadow>
        </value>
        <value name="normalize">
          <shadow type="logic_boolean">
            <field name="BOOL">FALSE</field>
          </shadow>
        </value>
        <value name="max_iter">
          <shadow type="math_number">
            <field name="NUM">300</field>
          </shadow>
        </value>
        <value name="random_state">
          <shadow type="math_number">
            <field name="NUM">None</field>
          </shadow>
        </value>
      </block>
      <block type="sklearn_DecisionTreeClassifier_Regressor">
        <value name="model_name">
          <shadow type="variables_get">
            <field name="VAR">model</field>
          </shadow>
        </value>
        <value name="max_depth">
          <shadow type="math_number">
            <field name="NUM">None</field>
          </shadow>
        </value>
        <value name="random_state">
          <shadow type="math_number">
            <field name="NUM">None</field>
          </shadow>
        </value>
      </block>
      <block type="sklearn_RandomForestClassifier_Regressor">
        <value name="model_name">
          <shadow type="variables_get">
            <field name="VAR">model</field>
          </shadow>
        </value>
        <value name="n_estimators">
          <shadow type="math_number">
            <field name="NUM">100</field>
          </shadow>
        </value>
        <value name="max_depth">
          <shadow type="math_number">
            <field name="NUM">None</field>
          </shadow>
        </value>
        <value name="n_jobs">
          <shadow type="math_number">
            <field name="NUM">None</field>
          </shadow>
        </value>
        <value name="random_state">
          <shadow type="math_number">
            <field name="NUM">None</field>
          </shadow>
        </value>
      </block>
      <block type="sklearn_KNeighborsClassifier_Regressor">
        <value name="model_name">
          <shadow type="variables_get">
            <field name="VAR">model</field>
          </shadow>
        </value>
        <value name="K">
          <shadow type="math_number">
            <field name="NUM">5</field>
          </shadow>
        </value>
        <value name="n_jobs">
          <shadow type="math_number">
            <field name="NUM">None</field>
          </shadow>
        </value>
      </block>
      <block type="sklearn_GaussianNB">
        <value name="model_name">
          <shadow type="variables_get">
            <field name="VAR">model</field>
          </shadow>
        </value>
      </block>
      <block type="sklearn_KMeans">
        <value name="model_name">
          <shadow type="variables_get">
            <field name="VAR">model</field>
          </shadow>
        </value>
        <value name="n_clusters">
          <shadow type="math_number">
            <field name="NUM">8</field>
          </shadow>
        </value>
        <value name="max_iter">
          <shadow type="math_number">
            <field name="NUM">300</field>
          </shadow>
        </value>
        <value name="random_state">
          <shadow type="math_number">
            <field name="NUM">None</field>
          </shadow>
        </value>
        <value name="n_jobs">
          <shadow type="math_number">
            <field name="NUM">None</field>
          </shadow>
        </value>
      </block>
      <block type="sklearn_fit">
        <value name="model_name">
          <shadow type="variables_get">
            <field name="VAR">model</field>
          </shadow>
        </value>
        <value name="train_data">
          <shadow type="variables_get">
            <field name="VAR">X_train</field>
          </shadow>
        </value>
        <value name="train_target">
          <shadow type="variables_get">
            <field name="VAR">y_train</field>
          </shadow>
        </value>
      </block>
      <block type="sklearn_score">
        <value name="model_name">
          <shadow type="variables_get">
            <field name="VAR">model</field>
          </shadow>
        </value>
        <value name="train_data">
          <shadow type="variables_get">
            <field name="VAR">X_test</field>
          </shadow>
        </value>
        <value name="train_target">
          <shadow type="variables_get">
            <field name="VAR">y_test</field>
          </shadow>
        </value>
      </block>
      <block type="sklearn_predict">
        <value name="model_name">
          <shadow type="variables_get">
            <field name="VAR">model</field>
          </shadow>
        </value>
        <value name="train_data">
          <shadow type="variables_get">
            <field name="VAR">X_test</field>
          </shadow>
        </value>
      </block>
      <block type="sklearn_coef_intercept">
        <value name="model_name">
          <shadow type="variables_get">
            <field name="VAR">model</field>
          </shadow>
        </value>
      </block>
      <block type="sklearn_cluster_centers_labels_inertia">
        <value name="model_name">
          <shadow type="variables_get">
            <field name="VAR">model</field>
          </shadow>
        </value>
      </block>
      <block type="sklearn_save_load_model">
        <value name="model_name">
          <shadow type="variables_get">
            <field name="VAR">model</field>
          </shadow>
        </value>
        <value name="address">
          <shadow type="text">
            <field name="TEXT">D:/mixly/test.pkl</field>
          </shadow>
        </value>
      </block>
    </category>
    <!--<category id="catclass_make" colour="345">
      <category id="catclass" colour="345" custom="CLASS">
      </category>
      <category id="catproperty" colour="345" custom="PROPERTY">
      </category>
      <category id="catmethod" colour="345" custom="METHOD">
      </category>
      <category id="catobject" colour="345" custom="OBJECT">
      </category>
    </category>-->
  </xml>
  <script>
  if (company_block != null) {
    $('#toolbox').append(company_block);
  }
  if (myblock != null) {
    $('#toolbox').append(myblock);
  }
  </script>
  <script>
  function clearOutput() {
    $("#side_code").text("");
  }
  jQuery.fn.putCursorAtEnd = function() {
    return this.each(function() {
      // Cache references
      var $el = $(this),
        el = this;
      // Only focus if input isn't already
      if (!$el.is(":focus")) {
        $el.focus();
      }
      // If this function exists... (IE 9+)
      if (el.setSelectionRange) {
        // Double the length because Opera is inconsistent about whether a carriage return is one character or two.
        var len = $el.val().length * 2;
        // Timeout seems to be required for Blink
        setTimeout(function() {
          el.setSelectionRange(len, len);
        }, 1);
      } else {
        // As a fallback, replace the contents with itself
        // Doesn't work in Chrome, but Chrome supports setSelectionRange
        $el.val($el.val());
      }
      // Scroll to the bottom, in case we're in a tall textarea
      // (Necessary for Firefox and Chrome)
      this.scrollTop = 999999;
    });
  };
  </script>
</body>
</html>